#ifndef _TABU_LIST_
#define _TABU_LIST_ T_T
// ---- ---- 0w0 ---- ----
// A Tabu List design for PFS_Item::Solution (= vector<int>)
#include <queue>
#include <unordered_set>
#include <cstdint>
#include "pfs_calculator.h"

class TabuList {
	typedef PFS_Calculator::Solution Element;
	typedef uint32_t crc_t;

public:
  TabuList(size_t length);
	void Push(const Element& new_element);
  bool Has(const Element& element) const;
	size_t max_length() const { return max_length_; }

private:
  const size_t max_length_;
	static crc_t SimpleCRC(Element element);
	void Pop();
	void Push(crc_t key);
	bool Has(crc_t key) const { return crc_set_.find(key) != crc_set_.end(); }

  std::queue<crc_t> crc_queue_;
	std::unordered_set<crc_t> crc_set_;
};

// ---- ---- >w< ---- ----
#endif

